package com.newcapec.erp.ui;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class MenuBarUI {
    public static JMenuBar getMenuBar(){
        //菜单栏
        JMenuBar menuBar = new JMenuBar();

        JMenu menu = new JMenu("新增数据");
        menuBar.add(menu);

        JMenuItem menuItem = new JMenuItem("新增仓库");
        menuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new AddWarehouseUI();
            }
        });
        menu.add(menuItem);

        JMenuItem menuItem_1 = new JMenuItem("新增储位");
        menuItem_1.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new AddStoreUI();
            }
        });
        menu.add(menuItem_1);

        JMenuItem menuItem_2 = new JMenuItem("新增客户");
        menuItem_2.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new AddClientUI();

            }
        });
        menu.add(menuItem_2);

        JMenuItem menuItem_3 = new JMenuItem("新增系统");
        menuItem_3.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new AddUserUI();
            }
        });
        menu.add(menuItem_3);

        JMenuItem menuItem_4 = new JMenuItem("新增存储");
        menuItem_4.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new AddInventoryUI();
            }
        });
        menu.add(menuItem_4);

        return menuBar;
    }
}
